from django.urls import path
from . import views

urlpatterns = [
    path('', views.index, name='index'),

    # api
    path('api/v1/cars/', views.CarsApiView.as_view(), name='api_all_cars'),
    path('api/v1/cars/<int:pk>/', views.CarsIdApiView.as_view(), name='api_id_car'),
    path('api/v1/cargos/', views.CargoApiView.as_view(), name='api_all_cargos'),
    path('api/v1/cargos/<int:pk>/', views.CargosIdApiView.as_view(), name='api_id_cargos'),
    path('api/v1/locations/', views.LocationApiView.as_view(), name='api_all_locations'),

    # cargo
    path('cargos/', views.cargos, name='cargos'),
    path('cargo_new/', views.cargo_new, name='cargo_new'),
    path('cargo_delete/<int:pk>/', views.cargo_delete, name='cargo_delete'),
    path('cargo_view/<int:pk>/', views.cargo_view, name='cargo_view'),
    path('cargo/<int:pk>/', views.CargoView.as_view(), name='cargo_update'),

    # car
    path('cars/', views.all_cars, name='all_cars'),  # все машины
    path('car/<int:pk>/', views.CarView.as_view(), name='CarView'),  # машина по id
    #path('cars/new_car', views.new_car, name='new_car'),

    # location
    path('lenloc/', views.lenloc, name='lenloc'),
    path('locations/', views.locations, name='locations'),
    path('locations_files_download', views.locations_files_download, name='locations_files_download'),

    # random
    path('reupdate', views.reupdate, name='reupdate'),
    ]